home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 3620 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.5 KB

  1. Path: ifi.uio.no!usenet
  2. From: ludvigp@ifi.uio.no (Ludvig Pedersen)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: doubling pixels horizontally
  5. Date: 22 Feb 1996 16:27:01 GMT
  6. Organization: Dept. of Informatics, University of Oslo, Norway
  7. Message-ID: <2824.6626T859T1819@ifi.uio.no>
  8. References: <4f4ibc$gl9@news.cs.tu-berlin.de> <591.6610T1165T2102@login.eunet.no><1045.6611T753T2256@vip.cybercity.dk><4faoe1$47@sunsystem5.informatik.tu-muenchen.de><2991.6612T1034T625@vip.cybercity.dk><576.6613T1070T1730@login.eunet.no><1257.6614T57T922@vip.cybercity.dk><1982.6617T1096T103@ifi.uio.no><4gbjg3$104@sunsystem5.informatik.tu-muenchen.de>
  9.     <4518.6625T1142T92@ifi.uio.no> <5073.6626T469T1290@login.eunet.no>
  10. NNTP-Posting-Host: gymir.ifi.uio.no
  11. X-Newsreader: THOR 2.22 (Amiga;TCP/IP)
  12.  
  13. >>>try to check what's going on just by this code :)
  14. >>In my opinion good code don't need comments on *every* lines.
  15. >>It should be written in a way that it is easy to understand and
  16. >>there is easy to get an overview.
  17. >Like using structures. :)
  18. Yes, that's good! :)
  19.  
  20. >>[..........]
  21. >>mf256genhi:
  22. >>   move.w d3,(a0)+ : addq.w #2,d3 : move.l d0,(a0)+  ;store hiwd ! -2(a0)
  23. >>   move.w d3,-2(a0) : addq.w #2,d3 : move.w d0,(a0)+ ;store lowd
  24. >>;every 2nd plane same data
  25. >>   move.w d3,(a0)+ : addq.w #2,d3 : move.l d0,(a0)+  ;store hiwd ! -2(a0)
  26. >>   move.w d3,-2(a0) : addq.w #2,d3 : move.w d0,(a0)+ ;store lowd
  27. >>[...]
  28. >>   move.l #$00e1fffe,d4 : or.l d2,d4           ;WAS: 00df
  29. >>   movem.l (sp)+,d0-d7/a1-a6 ;a0=(ptr)copl
  30. >>   rts
  31. >Whow! What a mess. :)
  32. I don't think you are the only one which agree's about that! ;)
  33.  
  34.  
  35. >>>: I have also made a version without sprite-dither with the same algorithm.
  36. >>>=:o oooh! But it's non-ideal, right ? how you get normal planar words
  37. >>>out of THAT mess :) 01010101 how you get together the 0's to 0000 ?
  38. >>I don't get it??? ;) It is optimal. That was actually VERY easy. Remeber
  39. >>that we are taking about 2x2 without sprite-dithering!!
  40. >He forgot that it was 2xn
  41. He probably did.
  42.  
  43. >>>: system-friendly as possible by using QBlit for the blitterpasses.
  44. >>>I currently got problems with my way of calling qblit. You got a demo
  45. >>>executable ? Mine locks up with small OS-blits :\
  46. >>I don't have that problem. You can look at the source. It will be released
  47. >>this week.
  48. >Hmm.. Yes you do. Its tha same locker we have. Exept we MAY have found a
  49. >solution. Guess it will lock when I implement it in our world engine. :)
  50. Ohh..like you did! I thought it was that the CPU locked while blitting.
  51.  
  52. There is the solution(not to you, but the guy with the problem)
  53.  
  54. If you set a flag in CleanUp: and are polling this flag with CPU to see if the
  55. blitter is finish. It might never finish because you task uses all the CPU-
  56. time. and CleanUp is never run.
  57.  
  58. Don't do this:
  59.  
  60. .QCleanup:
  61.         move.l  #-1,_BlitterIsDone
  62.         moveq   #0,d0
  63.         rts
  64.  
  65. and this
  66.  
  67. while(!BlitterIsDone);      //infinite wait loop.
  68.  
  69. ------------------------------------------------------
  70. Send a signal instead!
  71.  
  72. Here is my code. (It works!)
  73.  
  74. .QCleanUp:
  75.         move.l  #-1,_BlitterIsDone
  76.         movem.l d0-a6,-(sp)
  77.         move.l  _BltPort,a0
  78.         moveq.l #0,d0
  79.         move.b  MP_SIGBIT(a0),d1
  80.         bset    d1,d0
  81.         move.l  4.w,a6
  82.         move.l  _Task,a1
  83.         CALL    Signal(a6)
  84.         movem.l (sp)+,d0-a6
  85.  
  86.         moveq   #0,d0
  87.         rts
  88.  
  89. And this:
  90.  
  91. while(!BlitterIsDone)
  92.   Wait(1l<<(BltPort->mp_SigBit));
  93.  
  94.  
  95. Now your task will be in wait-state until the blitter is finished.
  96.  
  97. Problem solved! :)
  98.  
  99.  
  100. <sb>Ludde - Amiga Demo Coder
  101. <sb>Virtual Reality & Official Be developer
  102. <sb>ludvigp@ifi.uio.no
  103.  
  104.